package com.he.test;

/**
 * @description: TODO
 * @Author: HCL
 * @Date: 2024/10/24 8:29
 */
public class StaticSingleton {

    //1 私有构造
    private StaticSingleton(){

    }

    //2 创建静态私有对象
    private static StaticSingleton singleton = new StaticSingleton();

    //3 提供全局创建对象的方法
    public static StaticSingleton getInstance(){
        return singleton;
    }

    public void show(){
        System.out.println("饿汉");
    }

}
